Socket
Socket
Sign inDemoInstall

protocolify

Package Overview
Dependencies
2
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    protocolify

Prepend `http://` to humanized URLs like `todomvc.com` and `file://` to file paths


Version published
Weekly downloads
30K
decreased by-21.43%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

protocolify Build Status

Prepend http:// to humanized URLs like todomvc.com and file:// to file paths

Useful when you want to accept either a local file or URL as argument in your CLI app.

Install

$ npm install --save protocolify

Usage

const protocolify = require('protocolify');

protocolify('todomvc.com');
//=> 'http://todomvc.com'

protocolify('localhost');
//=> 'http://localhost'

protocolify('http://todomvc.com');
//=> 'http://todomvc.com'

// if it exists on disk it will be interpreted as a file and not an URL
protocolify('index.js');
//=> 'file:///Users/sindresorhus/dev/protocolify/index.js'

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 13 Jan 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc